package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

@Controller
public class AppController {

    @RequestMapping("/get")
    public String get(HttpServletResponse response){
        try {
            response.setContentType("application/json");
            response.setCharacterEncoding("utf-8");
            String string = "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}";
            response.getWriter().print(string);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
